package com.wc.alorithm_blue_bridge._动态规划.线性DP.子2023;

/**
 * @Author congge
 * @Date 2025/4/1 23:03
 * @description
 * https://www.lanqiao.cn/courses/46292/learning/?id=4031838&compatibility=false
 */
public class Main {
    static int n = 2023;
    static String s = "";
    static long a, b, c, d; // 2 0 2 3

    public static void main(String[] args) {
        for (int i = 1; i <= n; i++) {
            s += i;
        }
        for (char ch : s.toCharArray()) {
            if (ch == '2') c += b;
            if (ch == '0') b += a;
            if (ch == '2') a += 1;
            if (ch == '3') d += c;
        }
        System.out.println(d);
    }
}

